package com.luaj.elasticsearch.service.impl;

import com.luaj.elasticsearch.mapper.SellerMapper;
import com.luaj.elasticsearch.pojo.Seller;
import com.luaj.elasticsearch.service.SellerService;
import com.luaj.elasticsearch.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 卢安杰
 * @date 2020-11-20 20:06
 */
@Service
public class SellerServiceImpl implements SellerService {
    @Autowired
    private SellerMapper sellerMapper;

    @Override
    public int countAllSeller() {
        return sellerMapper.selectCount(null);
    }

    @Override
    public void create(Seller sellerModel) {
        sellerMapper.insertSelective(sellerModel);
    }

    @Override
    public List<Seller> selectAll() {
        return sellerMapper.selectAll();
    }

    @Override
    public Seller changeStatus(Seller sellerModel) {
        sellerMapper.updateByPrimaryKeySelective(sellerModel);
        return sellerMapper.selectOne(sellerModel);
    }
}
